package com.TeacherInfoServer.common.service;

import com.TeacherInfoServer.common.Result;
import com.TeacherInfoServer.pojo.DTO.SearchDTO.TeacherSearchDTO;
import com.TeacherInfoServer.pojo.DTO.TeacherDTO;
import com.TeacherInfoServer.pojo.entity.Teacher;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import lombok.SneakyThrows;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 教师信息服务接口
 */
public interface TeacherService extends IService<Teacher> {


    Map<String,Object> getTeacherList(Integer pages, Integer size);

   // void addTeacher(Teacher teacher);

    Map<String,Object> searchTeacherList(TeacherSearchDTO teacherSearchDTO);

    @Transactional
    void addTeacher(TeacherDTO teacherDTO);

    //void updateTeacher(Teacher teacher);

    @Transactional
    void updateTeacher(TeacherDTO teacherDTO);

    Result<TeacherDTO> getOne(String teacher_id);


    boolean deleteTeacher(List<String> teacherIds);

    Teacher findTeacherByName(String name);

    Map<String,Object> getTeacherNameList(Integer currentPage,Integer pageSize,String teacherName);

    @SneakyThrows(IOException.class)
    void exportInfo(HttpServletResponse response);
}
